home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
026a
/
apndbar.zip
/
APNDBAR.UDF
Wrap
Text File
|
1991-07-04
|
2KB
|
55 lines
From UserID Jcoc on the ATBBS. 07/01/91.
Spun off of an original idea from 'Hman' on the ATBBS.
Do your own testing. No guarantees are made.
ApndBar() UDF displays a horizontal status bar during APPEND.
The bar will 'grow' across the screen as the APPEND progresses.
Placates nervous users by providing something moving on the screen.
Helps avoid 3 finger salutes (Ctrl+Alt+Del) in the middle of a long
operation when there's no screen 'action'.
The idea can be adapted to operations other than APPEND.
Note that an APPEND will take longer using ApndBar().
Example code:
set cursor off
clear
use <database>
public BarRow,BarStart,BarPos,BarLen,StartCnt,BarCount
do ApndBox && create box frame, set memvars
set dbtrap off
append from <filename> for ApndBar()
set dbtrap on
release BarRow,BarStart,BarPos,BarLen,StartCnt,BarCount
use
clear
set cursor on
FUNCTION ApndBar && displays a horizontal status bar
BarCount=BarCount-1
if BarCount>0
return .t.
else
BarCount=StartCnt
endif
if BarPos>=BarLen
BarPos=BarStart
@ BarRow,BarPos say replicate('▒',BarLen-BarStart) color w/b
@ BarRow,BarPos say chr(178) color bg+/b
else
@ BarRow,BarPos say chr(178) color bg+/b
BarPos=BarPos+1
endif
RETURN .t.
PROCEDURE ApndBox && sets up box for horizontal status bar
BarRow=12
store 21 to BarStart,BarPos
BarLen=21+39 && bar starting position + inside width of box
store 20 to StartCnt,BarCount && increments bar every 20 records
@ 9,20 fill to 13,60 color b/b
@ 9,20 to 13,60 double color w/b
@ 11,21 to 11,59 color w/b
@ 10,33 say 'Appending data' color w+/b
@ 12,21 say replicate('▒',39) color w/b
RETURN && procedure ApndBox